/*
 * Copyright (c) 2006-2021, RT-Thread Development Team
 *
 * SPDX-License-Identifier: Apache-2.0
 *
 * Change Logs:
 * Date           Author       Notes
 * 2025-05-13     Administrator       the first version
 */
#ifndef HARDWARE_SYSTEM_H_
#define HARDWARE_SYSTEM_H_

//引用所有需要用到的头文件
//RT-thread相关头文件
#include <drv_common.h> //里面已经有<rtthread.h> <board.h> <rtdevice.h>
#include "stm32f4xx.h"

//外设的相关头文件
#include "data.h"
#include "balance.h"
#include "motor.h"
#include "encoder.h"
#include "robot_selectinit.h"
#include "Gyroscope.h"
#include "app_pid.h"


//小车型号的枚举定义
typedef enum
{
    Mec_Car = 0,
    FourWheel_Car, //1
} CarMode;


/****** 外部变量定义，当其它c文件引用system.h时，也可以使用system.c定义的变量 ******/
extern rt_uint8_t Car_Mode;
extern float Encoder_precision;
extern float Wheel_perimeter;
extern float Wheel_spacing;
extern float Axle_spacing;


void HardwareInit(void);

/***宏定义***/
//开机(1000/100hz=10)秒后才允许控制小车进行运动
#define CONTROL_DELAY       1000
/***宏定义***/

//C库函数的相关头文件
#include <stdio.h>
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include "stdarg.h"

#endif /* HARDWARE_SYSTEM_H_ */
